import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testcase = "dbshop018-删除属性组"
firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,"商品管理","商品属性","属性分组")

# 轴定位
firefox.find_element_by_xpath\
    ('//td[contains(.,"%s")]/following-sibling::td[2]/a[2]'%(attributeGroupName)).click()
time.sleep(5)
firefox.switch_to.alert.accept()
time.sleep(5)
# 断言
try:
    firefox.find_element_by_xpath('//td[contains(.,"%s")]'%(attributeGroupName)).is_displayed()
    writeLog("%s 测试失败"%testcase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testcase)
# firefox.quit()